/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Structural.Memento;

/**
 *
 * @author Demoni
 */
public class Test {
    public static void main (String[] args){
        
        Caretaker caretaker = new Caretaker();
        
        Persona p = new Persona();
        p.setNombre("rodrigo");
        p.setNombre("Claudio");
        caretaker.addMemento(p.saveToMemento());
        p.setNombre("jose");
        caretaker.addMemento(p.saveToMemento());
        p.setNombre("juan");
        
        Memento m1 = caretaker.getMemento(0);
        Memento m2 = caretaker.getMemento(1);
        
        System.out.println(m1.getSavedState());
        System.out.println(m2.getSavedState());
    }
    
}
